package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.FeedBackMapper;
import com.ruoyi.system.domain.FeedBack;
import com.ruoyi.system.service.IFeedBackService;

/**
 * 留言反馈Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-06-10
 */
@Service
public class FeedBackServiceImpl implements IFeedBackService 
{
    @Autowired
    private FeedBackMapper feedBackMapper;

    /**
     * 查询留言反馈
     * 
     * @param feedBackId 留言反馈主键
     * @return 留言反馈
     */
    @Override
    public FeedBack selectFeedBackByFeedBackId(Long feedBackId)
    {
        return feedBackMapper.selectFeedBackByFeedBackId(feedBackId);
    }

    /**
     * 查询留言反馈列表
     * 
     * @param feedBack 留言反馈
     * @return 留言反馈
     */
    @Override
    public List<FeedBack> selectFeedBackList(FeedBack feedBack)
    {
        return feedBackMapper.selectFeedBackList(feedBack);
    }

    /**
     * 新增留言反馈
     * 
     * @param feedBack 留言反馈
     * @return 结果
     */
    @Override
    public int insertFeedBack(FeedBack feedBack)
    {
        feedBack.setCreateTime(DateUtils.getNowDate());
        return feedBackMapper.insertFeedBack(feedBack);
    }

    /**
     * 修改留言反馈
     * 
     * @param feedBack 留言反馈
     * @return 结果
     */
    @Override
    public int updateFeedBack(FeedBack feedBack)
    {
        return feedBackMapper.updateFeedBack(feedBack);
    }

    /**
     * 批量删除留言反馈
     * 
     * @param feedBackIds 需要删除的留言反馈主键
     * @return 结果
     */
    @Override
    public int deleteFeedBackByFeedBackIds(Long[] feedBackIds)
    {
        return feedBackMapper.deleteFeedBackByFeedBackIds(feedBackIds);
    }

    /**
     * 删除留言反馈信息
     * 
     * @param feedBackId 留言反馈主键
     * @return 结果
     */
    @Override
    public int deleteFeedBackByFeedBackId(Long feedBackId)
    {
        return feedBackMapper.deleteFeedBackByFeedBackId(feedBackId);
    }
}
